/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.inria.openmath.omapi;

/**
 *
 * @author Mr.Sam
 */
import java.math.BigInteger;
public interface ParserHandler {


    /**
     * Receives an object for locating the origin of OpenMath parsing events.
     *
     * <p>OpenMath parsers are strongly encouraged (though not absolutely
     * required) to supply a locator: if it does so, it must supply
     * the locator to the application by invoking this method before
     * invoking any of the other methods in the ParserHandler
     * interface.</p>
     *
     * <p>The locator allows the application to determine the end
     * position of any OpenMath-object related event, even if the parser is
     * not reporting an error.  Typically, the application will
     * use this information for reporting its own errors (such as
     * unsuported symbol.</p>
     *
     * <p>Note that the locator will return correct information only
     * during the invocation of the events in this interface.  The
     * application should not attempt to use it at any other time.</p>
     *
     * @param locator An object that can return the location of
     *                any OpenMath-object event.
     * @see fr.inria.openmath.omapi.Locator
     */
    public void setLocator(fr.inria.openmath.omapi.Locator locator) ;


    /**
     * Receives notification of the beginning of parse (of a set of
     * OpenMath-objects).
     *
     * <p>The OpenMath parser will invoke this method only once, before any
     * other methods in this interface (except for
     * setObjectLocator).</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     */
    public void startParse() throws OMException ;


    /**
     * Receives notification of the end of parse.
     *
     * <p>The OpenMath parser will invoke this method only once, and it will
     * be the last method invoked during the parse.  The parser shall
     * not invoke this method until it has either abandoned parsing
     * (because of an unrecoverable error) or reached the end of
     * the input (no more OpenMath objects).</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     */
    public void endParse() throws OMException ;


    /**
     * Receives notification of the beginning of a object element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * object element in the OpenMath-object; there will be a corresponding
     * endObject() event for every startObject() event
     * The element's content will be reported, in order, before the
     * corresponding endObject() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endObject
     */
    public void startObject() throws OMException ;


    /**
     * Receives notification of the end of an object element.
     *
     * <p>The Parser will invoke this method at the end of every
     * object element in the OpenMath-object; there will be a corresponding
     * startObject() event for every endObject() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startObject
     */
    public void endObject() throws OMException ;


    /**
     * Receives notification of the beginning of a application element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * application element in the OpenMath-object; there will be a
     * corresponding endApplication() event for every startApplication() event
     * The element's content will be reported, in order, before the
     * corresponding endApplication() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endApplication
     */
    public void startApplication() throws OMException ;


    /**
     * Receives notification of the end of an application element.
     *
     * <p>The Parser will invoke this method at the end of every
     * application element in the OpenMath-object; there will be a
     * corresponding startApplication() event for every endApplication()
     * event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startApplication
     */
    public void endApplication() throws OMException ;



    /**
     * Receives notification of the beginning of a attribution element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * attribution element in the OpenMath-object; there will be a
     * corresponding endAttribution() event for every startAttribution() event
     * The element's content will be reported, in order, before the
     * corresponding endAttribution() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endAttribution
     */
    public void startAttribution() throws OMException ;

    /**
     * Receives notification of the beginning of an attribute-pairs element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * attribute-pairs element in the OpenMath-object; there will be a
     * corresponding endAttribuePairs() event for every startAttributePairs()
     * event.
     * The element's content will be reported, in order, before the
     * corresponding endAttributePairs() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endAttributePairs
     */
    public void startAttributePairs() throws OMException ;


    /**
     * Receives notification of the end of an attribution element.
     *
     * <p>The Parser will invoke this method at the end of every
     * attribution element in the OpenMath-object; there will be a
     * corresponding startAttribution() event for every endAttribution()
     * event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startAttribution
     */
    public void endAttribution() throws OMException ;

    /**
     * Receives notification of the end of an attribute-pairs element.
     *
     * <p>The Parser will invoke this method at the end of every
     * attribute-pairs element in the OpenMath-object; there will be a
     * corresponding startAttributePairs() event for every endAttributePairs()
     * event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startAttributePairs
     */
    public void endAttributePairs() throws OMException ;



    /**
     * Receives notification of the beginning of a bind element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * bind element in the OpenMath-object; there will be a
     * corresponding endBind() event for every startBind() event
     * The element's content will be reported, in order, before the
     * corresponding endBind() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endBind
     */
    public void startBind() throws OMException ;


    /**
     * Receives notification of the beginning of a bvar element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * bvar element in the OpenMath-object; there will be a
     * corresponding endBVars() event for every startBVars()
     * event.
     * The element's content will be reported, in order, before the
     * corresponding endBVars() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endBVars
     */
    public void startBVars() throws OMException ;


    /**
     * Receives notification of the end of an bind element.
     *
     * <p>The Parser will invoke this method at the end of every
     * bind element in the OpenMath-object; there will be a
     * corresponding startBind() event for every endBind()
     * event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startBind
     */
    public void endBind() throws OMException ;


    /**
     * Receives notification of the end of an bvars element.
     *
     * <p>The Parser will invoke this method at the end of every
     * bvars element in the OpenMath-object; there will be a
     * corresponding startBVars() event for every endBVars()
     * event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startBVars
     */
    public void endBVars() throws OMException ;


    /**
     * Receives notification of the beginning of a error element.
     *
     * <p>The Parser will invoke this method at the beginning of every
     * error element in the OpenMath-object; there will be a corresponding
     * endError() event for every startError() event
     * The element's content will be reported, in order, before the
     * corresponding endError() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     * @see #endError
     */
    public void startError() throws OMException ;


    /**
     * Receives notification of the end of an error element.
     *
     * <p>The Parser will invoke this method at the end of every
     * error element in the OpenMath-object; there will be a corresponding
     * startError() event for every endError() event.</p>
     *
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see #startError
     */
    public void endError() throws OMException ;


    /**
     * Receives notification of a Integer element.
     *
     * <p>The Parser will invoke this method each time a Big Integer element is
     * parsed.</p>
     *
     * @param value the value embedded in this Integer element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     */
    public void readInteger(int value) throws OMException ;


    /**
     * Receives notification of a Big Integer element.
     *
     * <p>The Parser will invoke this method each time a Big Integer element is
     * parsed.</p>
     *
     * @param value the value embedded in this Integer element. This is an
     *  infinite precision integer.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     */
    public void readInteger(BigInteger value) throws OMException ;


    /**
     * Receives notification of a floating-point number element.
     *
     * <p>The Parser will invoke this method each time a float element is
     * parsed.</p>
     *
     * @param value the value embedded in this Float element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     */
    public void readFloat(double value) throws OMException ;

    /**
     * Receives notification of a string element.
     *
     * <p>The Parser will invoke this method each time a string element is
     * parsed.</p>
     *
     * @param value the value embedded in this String element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     */
    public void readString(String value) throws OMException ;


    /**
     * Receives notification of a variable element.
     *
     * <p>The Parser will invoke this method each time a variable element
     * is parsed.</p>
     *
     * @param name the name of this Variable element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     */
    public void readVariable(String name) throws OMException ;


    /**
     * Receives notification of a byteArray element.
     *
     * <p>The Parser will invoke this method each time a byteArray element
     * is parsed.</p>
     *
     * @param value the value embedded in this ByteArray element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     *
     */
    public void readByteArray(byte[] value) throws OMException ;


    /**
     * Receives notification of a symbol element.
     *
     * <p>The Parser will invoke this method each time a symbol element
     * is parsed.</p>
     *
     * @param value the value embedded in this Symbol element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     * @see Symbol
     */
    public void readSymbol(Symbol value) throws OMException ;


    /**
     * Receives notification of a comment element.
     *
     * <p>The Parser will invoke this method each time a comment element
     *  is parsed.</p>
     *
     * @param value the value embedded in this Comment element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     */
    public void readComment(String value) throws OMException ;

    /**
     * Receives notification of a processing instruction.
     *
     * <p>The Parser will invoke this method each time a processing instruction
     *  is parsed.</p>
     *
     * @param value the value embedded in this Processing Instruction element.
     * @exception fr.inria.openmath.omapi.OMException Any OpenMath exception.
     */
    public void readPInstruction(String value) throws OMException ;

}

